<?php
$this->Html->addCrumb('Home', '/admin', array('icon' => 'home'));
$this->Html->addCrumb(__('Provinces'),$this->here);
if ($this->request->params['action'] == 'admin_edit') {
	$this->Html->addCrumb($this->data['Province']['name'], array(
		 'controller' => 'provinces', 'action' => 'edit',
		$this->params['pass'][0]
	));
}

if ($this->request->params['action'] == 'admin_add') {
	$this->Html->addCrumb(__('Add'), $this->here);
}
   echo $this->element('admin/breadcrumb');
   echo $this->element('admin/search');

?>

<div class ="row-fluid">
  <div class ="span12 actions">
  <?php echo $this->Html->link('Thêm mới Quận/Huyện', array('controller' => 'provinces', 'action' => 'add', 'admin' => true,),array ('class'=>'btn btn-success')); ?>
  
  </div>

</div>
<table class="table table-striped">
<thead>
		<?php
			echo $this->Html->tableHeaders(array(
					array('STT'=>array('class'=>'info')),
					array('Tên'=>array('class'=>'info')),
					array('Bí Danh'=>array('class'=>'info')),
					array('Tỉnh Thành'=>array('class'=>'info')),
					array('Trạng Thái'=>array('class'=>'info')),
				    array('Thao tác'=>array('class'=>'info'))));
		?>
<tbody>
		<?php if(empty($provinces)): ?>
		<tr>
			<td colspan="1" class="striped-info">No record found.</td>
		</tr>
		<?php endif; ?>
		<?php foreach ($provinces as $province):?>
		<tr>
		<td><?php echo $province['Province']['id']?></td>
		<td><?php echo $province['Province']['name']?></td>
		<td><?php echo $province['Province']['alias']?></td>
		<td><?php echo $province['City']['name']?></td>
		<td><?php echo $this->Html->link($this->Html->image('icon_' . $province['Province']['status'] . '.png'), array('controller' => 'provinces', 'action' => 'switch', 'status', $province['Province']['id']), array('class' => 'status', 'escape' => false));?></td>
		<td>
		<div class ="item-actions">
           <a href="<?php echo $this->Html->url(array('controller' => 'provinces', 'action' => 'edit', $province['Province']['id'],'admin'=>true,)); ?>"><i class="icon-pencil icon-large"></i></a>
           <a href="<?php echo $this->Html->url(array('controller' => 'provinces', 'action' => 'delete', $province['Province']['id'],'admin'=>true,)); ?>"><i class="icon-trash icon-large"></i></a>
		</div>
		</td>
         
		</tr>
		<?php endforeach;?>
		</tbody>		
</thead>
</table>
<div class="pagination pagination-centered pagination-mini">
	  <ul>
		<?php echo $this->Paginator->prev(''); ?>
		<?php echo $this->Paginator->numbers(array('first' => 2, 'last' => 2));?>
		<?php echo $this->Paginator->next(''); ?>
	  </ul>
</div>